﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Store/StoreMastePage.Master" AutoEventWireup="true" CodeBehind="ViewPurchasedOrders.aspx.cs" Inherits="logicunivesityinventorystore.Store.ViewPurchasedOrders" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" runat="server" 
    contentplaceholderid="ContentPlaceHolder2">
        <h1>View Purchase Orders</h1>

        <table>
            <tr>
                <td>
                    Choose Supplier:
                </td>
                <td>
                    <asp:DropDownList ID="ddlsuppliers" runat="server" 
                        DataSourceID="ObjectDataSource1" DataTextField="SupplierName" 
                        DataValueField="SupplierID" AutoPostBack="True"></asp:DropDownList>
                    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                        SelectMethod="FindAll" TypeName="BusinessLogicLayer.SuppliersFacade">
                    </asp:ObjectDataSource>
                </td>
                
            </tr>
            <tr>
            <td>
                <br />
            </td>
            </tr>
            </table>
                    <asp:GridView ID="gv_PurchaseOrders" runat="server" 
                        DataSourceID="ObjectDataSource2" AutoGenerateColumns="False" 
            onrowcommand="gv_PurchaseOrders_RowCommand" CssClass="gridview">
                        <Columns>
                            <asp:TemplateField HeaderText="Order No.">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButton1" runat="server" 
                                        CommandArgument='<%# Eval("PoNo") %>' CommandName="Select" 
                                        Text='<%# Eval("PoNo") %>'></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="ClerkID" HeaderText="ClerkID" />
                            <asp:BoundField DataField="OrderDate" HeaderText="OrderDate" />
                            <asp:BoundField DataField="ExpectedDate" HeaderText="ExpectedDate" />
                            <asp:BoundField DataField="Status" HeaderText="Status" />
                        </Columns>
                    </asp:GridView>
                    <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
                        SelectMethod="FindAllOrderBySupplier" 
                        TypeName="BusinessLogicLayer.OrderFacade">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="ddlsuppliers" DefaultValue="ALPA" Name="supID" 
                                PropertyName="SelectedValue" Type="String" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
               
            
             <br /><br />

            <asp:GridView ID="gv_OrderDetails" runat="server">
        </asp:GridView>
               
            
       

            </asp:Content>

<asp:Content ID="Content3" runat="server" 
    contentplaceholderid="ContentPlaceHolder3">
  
                </asp:Content>
<asp:Content ID="Content4" runat="server" 
    contentplaceholderid="ContentPlaceHolder5">

                </asp:Content>
<asp:Content ID="Content5" runat="server" 
    contentplaceholderid="ContentPlaceHolder1">
     
                </asp:Content>
<asp:Content ID="Content6" runat="server" 
    contentplaceholderid="ContentPlaceHolder6">
  
                </asp:Content>
<asp:Content ID="Content7" runat="server" 
    contentplaceholderid="ContentPlaceHolder7">
                </asp:Content>


